package com.yzf.wisecoder.wisecoderservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yzf.wisecoder.wisecoderstorage.mysql.entity.ViewDatasourceEntity;

import java.util.List;

/**
 * @author jianghuiyong
 * @email jianghuiyong@yunzhangfang.com
 * @date 2020-05-12 20:05:20
 */
public interface ViewDatasourceService extends IService<ViewDatasourceEntity> {

    /**
     * 根据数据源ID查询模板设置的数据源
     *
     * @param dbId
     * @return
     */
    List<ViewDatasourceEntity> queryByDbId(Long dbId);

    /**
     * 更改某大屏展示的数据源配置
     *
     * @param viewId
     * @param viewDatasourceEntityList
     * @return
     */
    Boolean saveOrUpdateViewDataSourceList(Long viewId, List<ViewDatasourceEntity> viewDatasourceEntityList);

    /**
     * 删除大屏相关的数据源配置
     *
     * @param viewId
     * @return
     */
    Boolean removeByViewId(Long viewId);

    /**
     * 查询视图组件数据源配置
     *
     * @param viewId
     * @return
     */
    List<ViewDatasourceEntity> queryByViewId(Long viewId);

    /**
     *
     * @param projectIds
     * @return
     */
    boolean removeByProjectId(List<Long> projectIds);
}

